<?PHP
 require_once('inc/int.php');
 require_once('inc/releases.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>DMDirc :: <?PHP echo t('menu_releases'); ?></title>
  <link rel="stylesheet" type="text/css" href="res/style.css">
  <link rel="icon" type="image/png" href="res/favicon.png">
 </head>
 <body>
  <div id="container">
   <img id="logo" src="res/logo.png" alt="DMDirc logo">
   <h1>DMDirc</h1>
<?PHP define('PAGE', 'releases'); define('SUBPAGE', 'stable'); require_once('inc/menu.php'); ?>
   <div id="content">

    <h2><?PHP echo t('menu_releases'); ?></h2>

<?PHP foreach ($releases['latest'] as $name => $release) { if (!is_array($release)) { continue; } ?>
    <div class="left download_os">
     <img src="res/<?PHP echo $name; ?>.png" alt="<?PHP echo ucfirst($name); ?>" class="osicon">
     <a href="<?PHP echo $release['url']; ?>" class="download_link">
      Download the <?PHP echo $release['title']; ?>
     </a>
     <p>
      <?PHP echo basename($release['url']), ', ', $release['size']; ?>
      <?PHP if (isset($release['docs'])) {
       echo '</p><p class="instructions"><img src="res/icon/help.png" alt="Help icon"> <a href="documentation/', $release['docs'], '">Installation instructions</a>';
      } ?>
     </p>
    </div>
<?PHP } ?>

    <div class="right" style="margin-top: 30px; margin-right: 40px; padding: 10px; border: 1px solid #6f6; background-color: #cfc;">
     <h3>Unstable releases</h3> 
     <p>
      In addition to the stable downloads available here, we also offer
      nightly and unstable releases.
     </p>
     <p>
      <a href="nightlies">Nightly releases</a>
      are automatically generated each night, and reflect the very latest
      development on DMDirc. They will all of the latest features, but may
      contain major bugs or issues, and could potentially corrupt your
      settings.
     </p>
<?php if ($releases['unstable'] != $releases['latest']) { ?>
     <p>
      <a href="unstablereleases">Unstable releases</a>
      are previews of upcoming DMDirc versions. They should be feature
      complete, and not contain any major bugs, but they are likely to 
      have more problems than the stable releases on this page.
     </p>
<?PHP } ?>
    </div>

    <h2 style="clear: both; padding-top: 15px;"><?PHP echo t('releases_other'); ?></h2>

    <?PHP echo t('releases_blurb'); ?>
   </div>
   <div id="footer">
   </div>
  </div>
 </body>
</html>
